package com.zmht.beike.biz.impl;

import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.zmht.beike.biz.ItestBiz;
import com.zmht.beike.dao.ITestDAO;
import com.zmht.beike.dao.impl.TestDAOImpl;
import com.zmht.beike.po.StudentTwo;
import com.zmht.beike.po.Test;

public class TestBiz implements ItestBiz {
	private ITestDAO testDAO;

	public ITestDAO getTestDAO() {
		return testDAO;
	}

	public void setTestDAO(ITestDAO testDAO) {
		this.testDAO = testDAO;
	}

	public boolean save(Test t) {
		try {
			testDAO.saveObj(t);
		} catch (Exception e) {
			
			e.printStackTrace();
		}
		
		return false;
	}
	
	public static void main(String [] args){
	ApplicationContext cxt;
		cxt = new ClassPathXmlApplicationContext(new String[]{"spring/spring.xml","spring/spring_dao.xml","spring/spring_beike.xml",});
	
		TestDAOImpl dao  = (TestDAOImpl)cxt.getBean("testDAO");
		
		List<StudentTwo> list = dao.findByHQLObj("from StudentTwo");
		for(StudentTwo st:list){
			st.setSumCognition("0.00");
			st.setSumHabit("0.00");
			st.setSumHealth("0.00");
			st.setSumLanguage("0.00");
			st.setSumSociality("0.00");
			dao.updateObj(st);
			
		}
		//List list = biz.getBSMHostByHgi(25);
	
		
	}

}
